package com.hfh.io;

import org.junit.Test;

import java.io.BufferedInputStream;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;

public class BufferStreamDemo {
    @Test
    public void test() throws IOException {
        BufferedInputStream bis = new BufferedInputStream(new FileInputStream("file/txt/《遮天》.txt"));
        byte[] arr = new byte[1024];
        int len;
        while ((len=bis.read(arr))!=-1){
//            System.out.println(bis.read(arr, 0, len));
            System.out.println(new String(arr, 0, len));
        }
    }

}
